package com.birdy.user.service;

import com.birdy.vo.UserInfo;

/**
 * @author birdy
 * @date 2022/3/31 10:12 PM
 */
public interface IUserService {
    /**
     * 新建/更新 用户
     * @param openid openid
     * @param userInfo 用户信息
     * @return res
     */
    int addUserInfo(String openid, UserInfo userInfo);

    /**
     * 新增用户
     * @param openid openid
     * @return res
     */
    int addUser(String openid);
    /**
     * 检查用户是否注册
     * @param openid openid
     * @return res
     */
    String checkUserRegister(String openid);

    /**
     * check user register in userinfo
     * @param openid user openid
     * @return openid or null
     */
    String checkUserInfoRegister(String openid);

    /**
     * update user info in userinfo
     * @param openid user openid
     * @param userInfo userinfo with avatar and name
     * @return update data row
     */
    int updateUserInfo(String openid, UserInfo userInfo);

    /**
     * select user info by openid
     * @param openid openid
     * @return userinfo
     */
    UserInfo getUserInfo(String openid);
}
